package br.com.perkins.myproject.domain;

import java.io.Serializable;

import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table
public class AcessoSubmenu implements Serializable {

	@EmbeddedId
	private AcessoSubmenuPK id = new AcessoSubmenuPK();

	@ManyToOne
	@JoinColumn(name="submenu_id",referencedColumnName="id",insertable=false,updatable=false)
	private Submenu submenu;

	@ManyToOne
	@JoinColumn(name="grupoUsuarios_id",referencedColumnName="id",insertable=false,updatable=false)
	private GrupoUsuarios grupoUsuarios;

	//constructors
	public AcessoSubmenu() {
		super();
	}
	public AcessoSubmenu(Integer grupoUsuarios, Integer submenu) {
		super();
		this.id = new AcessoSubmenuPK(grupoUsuarios,submenu);
	}

	//getters and setters
	public AcessoSubmenuPK getId() {
		return id;
	}
	public void setId(AcessoSubmenuPK id) {
		this.id = id;
	}

	public Submenu getSubmenu() {
		return submenu;
	}
	public void setSubmenu(Submenu submenu) {
		this.submenu = submenu;
	}
	public GrupoUsuarios getGrupoUsuarios() {
		return grupoUsuarios;
	}
	public void setGrupoUsuario(GrupoUsuarios grupoUsuarios) {
		this.grupoUsuarios = grupoUsuarios;
	}

}